<template>
	<div class="recommend">
		<div class="title">
			<img class="title-img" src="http://img1.qunarzz.com/piao/fusion/1711/16/bfbb9874e8f11402.png" />
			<span>热门推荐</span>
		</div>
		<ul>
			<router-link :to='"/detail/" + item.id' tag="li" class="item border-bottom" v-for="item of recommend" :key="item.id">
				<div class="item-img-wrapper">
					<img class="item-img" :src="item.imgUrl" />
				</div>
				<div class="item-info">
					<p class="item-title">{{item.title}}</p>
					<p class="item-desc">{{item.desc}}</p>
					<button class="item-button">查看详情</button>
				</div>
			</router-link>
		</ul>
	</div>
	
</template>

<script>
	export default {
		name: 'homeRecommend',
		props: {
			recommend: Array
		},
		data() {
			return {
			};
		}
	}
</script>

<style scoped lang="stylus">
	@import '~styles/varibles.styl'
	.title 
	 background: #eee
	 line-height .8rem
	 margin-top: .2rem
	 text-indent: .2rem
	 .title-img 
	  width: .3rem
	  height: .3rem
	  vertical-align: center
	  display: inline-block
		position: relative
		top: -0.04rem
	.item 
	 display: flex
	 height: 2.1rem
	 overflow: hidden
	 .item-img 
	  width: 1.7rem
	  height: 1.7rem
	  padding: 0.2rem
	 .item-info
	  flex: 1
	  padding: 0.2rem
	  min-width: 0
	  .item-title
	   font-size: .32rem
	   line-height: .54rem
	   ellipsis()
	  .item-desc 
	   color: #ccc
	   line-height: .4rem
	   ellipsis()
	  .item-button 
	   margin-top: .16rem
	   padding: 0 .2rem
	   background: #ff9300
	   border-radius: 0.05rem
	   color: #fff
	   line-height: 0.44rem
</style>
